package ATM.gui;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JButton;

public class AddAccount extends JPanel {

	Screen screen;
	private JLabel lblAccount;
	private JLabel lblIntRate;
	private JLabel lblOvDraft;
	private JTextField tfldIntRateData;
	private JTextField tfldOvDraftData;
	private JComboBox<String> accountList;
	private JButton btnAdd;
	private JButton btnExit;
	private String[] accountTypes = { "Main Account", "Savings", "Other"};

	public AddAccount(Screen screen) {
		this.screen = screen;
		setLayout(null);
		
		lblAccount = new JLabel("Account:");
		lblAccount.setBounds(175, 141, 43, 14);
		add(lblAccount);

		lblOvDraft = new JLabel("Overdraft:");
		lblOvDraft.setBounds(175, 172, 52, 14);
		add(lblOvDraft);

		tfldOvDraftData =  new JTextField();
		tfldOvDraftData.setBounds(275, 169, 94, 20);
		add(tfldOvDraftData);

		lblIntRate = new JLabel("Interest rate:");
		lblIntRate.setBounds(175, 203, 66, 14);
		add(lblIntRate);

		tfldIntRateData = new JTextField();
		tfldIntRateData.setBounds(275, 200, 94, 20);
		add(tfldIntRateData);
		tfldIntRateData.setEditable(false);
		tfldIntRateData.setText("4");
		
		accountList = new JComboBox<String>(accountTypes);
		accountList.setBounds(275, 138, 94, 20);
		add(accountList);
		accountList.setActionCommand("AccountList");
		accountList.addActionListener(screen.getAdminaL());
		
		
		btnAdd = new JButton("Add");
		btnAdd.setBounds(515, 350, 89, 23);
		add(btnAdd);
		btnAdd.setActionCommand("AddThisAccount");
		btnAdd.addActionListener(screen.getAdminaL());
		
		btnExit = new JButton("Exit");
		btnExit.setBounds(515, 375, 89, 23);
		add(btnExit);
		btnExit.setActionCommand("ViewCustomer");
		btnExit.addActionListener(screen.getAdminaL());

		JLabel image = (new JLabel(screen.getVariables().getImage1()));
		image.setBounds(0, 0, 640, 480);
		add(image);
	}
	
	

	public JTextField getTfldIntRateData() {
		return tfldIntRateData;
	}



	public void setTfldIntRateData(JTextField tfldIntRateData) {
		this.tfldIntRateData = tfldIntRateData;
	}



	public JTextField getTfldOvDraftData() {
		return tfldOvDraftData;
	}



	public void setTfldOvDraftData(JTextField tfldOvDraftData) {
		this.tfldOvDraftData = tfldOvDraftData;
	}



	public JComboBox<String> getAccountList() {
		return accountList;
	}

	public void setAccountList(JComboBox<String> accountList) {
		this.accountList = accountList;
	}

	public JButton getBtnAdd() {
		return btnAdd;
	}

	public void setBtnAdd(JButton btnAdd) {
		this.btnAdd = btnAdd;
	}
}
